package main

import (
	"e69cf466-686c-31d6-28ec-738611fe940b/test4"
	"log"
	"net/http"
	"os"
)

func SetupLogger() {
	logFileLocation, _ := os.OpenFile("test.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0744)
	log.SetOutput(logFileLocation)
}

func simpleHttpGet(url string) {
	resp, err := http.Get(url)

	if err != nil {
		log.Printf("访问 %s 出错, err: %s", url, err.Error())
	} else {
		log.Printf("访问 %s 返回的状态码为 %d", url, resp.StatusCode)
		resp.Body.Close()
	}
}

func main() {
	// 使用原生的 日志记录
	//SetupLogger()
	//simpleHttpGet("www.baidu.com")
	//simpleHttpGet("http://www.baidu.com")


	println("我是分割线=====================================================")
	//test1.Test1()
	//println("自定义zap>>>>>>>>>>>>>>>>>>>>")
	//test3.Test1()
	println("日志切割归档")
	test4.Test1()
}
